#include<bits/stdc++.h>
using namespace std;
int a[10000];
int main(){
    int n;
    int max,min;
    int sum = 0;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    max = a[0];
    min = max;
    for(int i = 0; i < n; i++){
        if(max < a[i]) max = a[i];
        if(min > a[i]) min = a[i];
        sum += a[i];
    }
    cout << max <<endl << min <<endl <<sum;
    return 0;
}